# encoding: utf-8
""" 
@version: v1.0 
@author: autumner 
@license: Apache Licence  
@contact: 18322313385@163.com 
@site:  https://gitee.com/autumner/pythoncookbook
@software: PyCharm 
@file: event_Thread_client.py 
@time: 2019/7/23 下午3:30
@note:
基于事件驱动的多线程socket客户端
"""
from socket import *

sock = socket(AF_INET, SOCK_DGRAM)
for x in range(48):
    sock.sendto(str(x).encode('ascii'), ('localhost', 17000))
    resp = sock.recvfrom(8192)
    print(resp[0])